import 'package:get/get.dart';
import 'package:flutter/material.dart';

class BindBankController extends GetxController {
  var bankCardController = TextEditingController();
  var phoneController = TextEditingController();
  var canBind = false.obs;

  @override
  void onInit() {
    super.onInit();
    bankCardController.addListener(_onInputChanged);
    phoneController.addListener(_onInputChanged);
  }

  void _onInputChanged() {
    canBind.value = bankCardController.text.isNotEmpty && phoneController.text.isNotEmpty;
  }

  void bindBank() {
    // 绑定银行卡逻辑
    Get.back();
    Get.snackbar('绑定成功', '银行卡已绑定');
  }

  @override
  void onClose() {
    bankCardController.dispose();
    phoneController.dispose();
    super.onClose();
  }
}
